#include <iostream>

using namespace std;

class Solution
{
public:
    int minimumChairs(string s)
    {
        int total = 0;
        int release = 0;
        for (const char c : s)
        {
            if (c == 'E')
            {
                if(release > 0)
                    release--;
                else
                    total++;
            }
            else
            {
                release++;
            }
        }
        return total;
    }
};

int main()
{
    cout << "Code3168" << endl;
    Solution s;
    return 0;
}